from django.db import models

class MenuTab(models.Model):
    label = models.CharField(max_length=50, verbose_name="标识")
    menu = models.CharField(max_length=50, verbose_name="菜单")
    menuNum = models.IntegerField(verbose_name="ID", default=1)

    class Meta:
        verbose_name_plural = "菜单"

    def __str__(self):
        return self.menu

# 用户表
class UserTab(models.Model):
    userName = models.CharField(max_length=50, verbose_name="用户名", unique=True)
    password = models.CharField(max_length=100, verbose_name="密码")
    email = models.CharField(max_length=50, verbose_name="邮箱", null=True, blank=True)
    # menu = models.ManyToManyField(MenuTab, verbose_name="菜单")
    menu = models.CharField(max_length=255, verbose_name="菜单", null=True, blank=True)
    isDel = models.BooleanField(verbose_name="是否删除", default=False)

    class Meta:
        verbose_name_plural = "系统用户"

    def __str__(self):
        return self.userName